package com.base;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import com.soar.jdbc.dbhelper.DbParameter;
import com.soar.jdbc.dbhelper.DbTemplates;
import com.soar.jdbc.dbhelper.SameTypes;
import com.soar.jdbc.dbhelper.SqlTypes;
import com.soar.jdbc.dbhelper.WhereTypes;

public class Commutil
{

	/**
	 * 获取当前时间并格式化
	 * 
	 * @throws ParseException
	 */
	public static String getCurrentDate() throws ParseException
	{
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
		String   date   =   formatter.format(new Date());
		return date; 
	}
	
	/**
	 * 轮循码头箱动态数据库表
	 * @param contractNo 委托号
	 * @throws Exception
	 */
	public static void selectTerminalBox(String contractNo) throws Exception
	{
		DbParameter param = new DbParameter("CONTRACT_OTHERS");
		param.setSelectFields("CNTR_NO,REC_TIM");
		param.setWhereParams("CONTRACT_NO", contractNo, SqlTypes.VARCHAR, WhereTypes.NOT, SameTypes.YES);
		List<HashMap<String,String>> list = DbTemplates.select(DbUtil.openConnection(), param);
		if(list.size()>0)
		{
			
		}
	}
	
}
